<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header">
    <style type="text/css">
        .menu {
            width: 250px;
            height: 100%;
            position: fixed;
            background-color: seagreen;
            -webkit-transition: all 1s;
            transition: all 1s;
            left: 0;
            z-index: 50;
            overflow-y: auto;
            padding-bottom: 100px;
        }
        .menu.closed {
            left: -250px;
        }
        #toggle {
            background-color: seagreen;
            height: 100%;
            min-height: 100%;
            width: 50px;
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0px;
            z-index: 25;
            -webkit-transition: all 0.7s ease;
            transition: all 0.7s ease;
        }
        #toggle:hover {
            cursor: pointer;
        }
        #toggle.closed {
            left: 0px;
            top: 0;
            bottom: 0;
            right: 0;
            width: 100%;
            height: 100%;
            opacity: 0.3;
        }
        .content {
            width: 100%;
            height: 100%;
            margin-left: 0px;
            -webkit-transition: all 0.4s;
            transition: all 0.4s;
        }
        .content.closed .text {
            -webkit-transform: translateX(80px);
            -ms-transform: translateX(80px);
            transform: translateX(80px);
        }
        .text {
            width: 60%;
            margin: auto;
            -webkit-transition: all 1s;
            transition: all 1s;
            margin-top: 80px;
            margin-bottom: 80px;
        }
        h1,
        h2 {
            color: #444;
        }
        p {
            color: #444;
        }
        p img {
            float: left;
            margin: 15px;
        }
        .menu ul {
            list-style-type: none;
            padding: 0;
            margin: 85px 0 0 40px;
            padding-right: 40px;
        }
        .menu ul li {
            color: floralwhite;
            font-size: 20px;
            margin: 0 0 5px 0;
            display: block;
            height: 40px;
            line-height: 40px;
            padding-left: 10px;
            -webkit-transition: all 0.3s;
            transition: all 0.3s;
        }
        .menu ul li:hover {
            background-color: #3bb16f;
            cursor: pointer;
        }
        #wrapper {
            height: 100%;
            min-height: 100%;
            position: fixed;
            overflow-y: auto;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
        #wrapper.closed {
            position: fixed;
        }
        hr {
            border: none;
            height: 1px;
            background-color: seagreen;
            position: relative;
            width: 90%;
            margin-left: 0;
        }
        hr:before {
            content: "/";
            display: block;
            top: -8px;
            left: -5px;
            position: absolute;
            color: seagreen;
        }
        *::-moz-selection {
            background-color: #1b5233;
            color: floralwhite;
        }
        *::selection {
            background-color: #1b5233;
            color: floralwhite;
        }

    </style>
</head>
<link rel="stylesheet" th:href="@{/css/yw.css}">
<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <h1>
        商务任务过程看板
    </h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <input type="hidden" id="AssignedId" name="id" class="form-control text-center" style="border: none; " th:value="${projectBaseInfo.id}">

                                <div class="form-group" style="margin-right: 10px;">
                                    <label>项目编号</label>
                                    <span class="form-control text-center" th:text="${projectBaseInfo.code}" style="border: none;"></span>
                                    <!--<input type="text" name="code" class="form-control text-center" style="border: none; " th:value="${projectBaseInfo.code}">-->
                                </div>
                                <div class="form-group" style="margin-right: 10px;">
                                    <label>项目名称</label>
                                    <span class="form-control text-center" th:text="${projectBaseInfo.name}" style="border: none;min-width:300px;"></span>
                                    <!--<input type="text" name="code" class="form-control text-center" th:value="${projectBaseInfo.name}" style="border: none; width:300px;">-->
                                </div>
                                <div class="form-group" style="margin-right: 10px;">
                                    <label>项目数量</label>
                                    <span class="form-control text-center" th:text="${projectBaseInfo.num}+${projectBaseInfo.unit}" style="border: none;min-width:100px;"></span>
                                    <!--<input type="text" name="code" class="form-control text-center"  th:value="${projectBaseInfo.num}+${projectBaseInfo.unit}" style="border: none; width:100px;">-->
                                </div>
                                <!--<div class="form-group" style="margin-right: 10px;margin-top: 5px;">-->
                                    <!--<label>设计类别</label>-->
                                    <!--<input type="text" name="designDepts" class="form-control" style="border: none; ">-->
                                <!--</div>-->
                                <div class="form-group" style="margin-right: 10px;">
                                    <label>需方</label>
                                    <span class="form-control text-center" th:text="${projectBaseInfo.demander}" style="border: none;min-width:300px;"></span>
                                    <!--<input type="text" name="demander" th:value="${projectBaseInfo.demander}" class="form-control text-center" style="border: none; ">-->
                                </div>
                                <div class="form-group" style="margin-right: 10px;">
                                    <label>安装地点</label>
                                    <span class="form-control text-center" th:text="${projectBaseInfo.address}" style="border: none;"></span>
                                    <!--<input type="text" name="address" th:value="${projectBaseInfo.address}" class="form-control text-center" style="border: none; ">-->
                                </div>

                            </div>
                        </div>
                    </form>
                </div>
                <div class="box-body">
                    <div class="mainbox">
                        <div class="responsive">
                            <table>
                                <tbody>
                                <tr>
                                    <!--<th style="background:#e4644a;border-right:2px solid #fff;">工作组</th>-->
                                    <th style="background:#7C90FF;border-right:2px solid #fff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;概算<div class="label badge" style="display: block;background-color: #7C90FF; color: #0a0a0a; float: right; margin-top: 10px; margin-right: 15px;" id="gaisuanCnt">&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
                                    <th style="background:#7C90FF;border-right:2px solid #fff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;预算<div class="label badge" style="display: block;background-color: #7C90FF; color: #0a0a0a; float: right; margin-top:10px; margin-right: 15px;" id="yusuanCnt">&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
                                    <th style="background:#09B2C7;border-right:2px solid #fff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;报价<div class="label badge" style="display: block;background-color: #09B2C7; color: #0a0a0a; float: right; margin-top:10px; margin-right: 15px;" id="baojiaCnt">&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
                                    <th style="background:#09B2C7;border-right:2px solid #fff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;合同<div class="label badge" style="display: block;background-color: #09B2C7; color: #0a0a0a; float: right; margin-top:10px; margin-right: 15px;" id="hetongCnt">&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
                                    <th style="background:#09B2C7;border-right:2px solid #fff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;款票<div class="label badge" style="display: block;background-color: #09B2C7; color: #0a0a0a; float: right; margin-top:10px; margin-right: 15px;" id="kuanpiaoCnt">&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
                                    <th style="background:#7C90FF;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;核算<div class="label badge" style="display: block;background-color: #7C90FF; color: #0a0a0a; float: right; margin-top:10px; margin-right: 15px;" id="hesuanCnt">0个</div></th>
                                </tr>

                                <!--<tr>-->
                                    <!--<td th:text="${user.id}"></td>-->
                                    <!--<td th:text="${user.username}"></td>-->
                                    <!--<td th:text="${user.password}"></td>-->
                                    <!--<td th:text="${user.petname}"></td>-->
                                <!--</tr>-->

                                <tr  th:each="tableData:${tableData}">
                                    <!--<td th:text="${tableData.groupName}"></td>-->
                                    <td  id="gaisuanStatus">

                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.hk} eq 0"></i>-->
                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.hk} eq 1"></i>-->
                                        <!--<i class="text-yellow fa fa-clock-o" th:if="${tableData.hk} eq 2"></i>-->
                                        <!--<i class="text-green fa fa-circle" th:if="${tableData.hk} eq 3"></i>-->
                                        <span class="label  badge label-danger" th:if="${tableData.hk} eq -1">不需要</span>
                                        <span class="label  badge label-default" th:if="${tableData.hk} eq 1" onclick="updateTask(7,1)" style="cursor: pointer;">未开始</span>
                                        <span class="label  badge label-warning" th:if="${tableData.hk} eq 2" onclick="updateTask(7,2)" style="cursor: pointer;">执行中</span>
                                        <span class="label  badge label-success" th:if="${tableData.hk} eq 3" onclick="updateTask(7,3)" style="cursor: pointer;">已完成</span>
                                    </td>
                                    <td id="yusuanStatus">

                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.ys} eq 0 "></i>-->
                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.ys} eq 1 "></i>-->
                                        <!--<i class="text-yellow fa fa-clock-o" th:if="${tableData.ys} eq 2"></i>-->
                                        <!--<i class="text-green fa fa-circle" ></i>-->
                                        <span class="label  badge label-danger" th:if="${tableData.ys} eq -1">不需要</span>
                                        <span class="label  badge label-default" th:if="${tableData.ys} eq 1">未开始</span>
                                        <span class="label  badge label-warning" th:if="${tableData.ys} eq 2">执行中</span>
                                        <span class="label  badge label-success" th:if="${tableData.ys} eq 3">已完成</span>
                                    </td>
                                    <td id="baojiaStatus">

                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.bj} eq 0 "></i>-->
                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.bj} eq 1 "></i>-->
                                        <!--<i class="text-yellow fa fa-clock-o" th:if="${tableData.bj} eq 2"></i>-->
                                        <!--<i class="text-green fa fa-circle" th:if="${tableData.bj} eq 3"></i>-->
                                        <span class="label  badge label-danger" th:if="${tableData.bj} eq -1">不需要</span>
                                        <span class="label  badge label-default" th:if="${tableData.bj} eq 1">未开始</span>
                                        <span class="label  badge label-warning" th:if="${tableData.bj} eq 2">执行中</span>
                                        <span class="label  badge label-success" th:if="${tableData.bj} eq 3">已完成</span>
                                    </td>
                                    <td id="hetongStatus">

                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.ht} eq 0 "></i>-->
                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.ht} eq 1"></i>-->
                                        <!--<i class="text-yellow fa fa-clock-o" th:if="${tableData.ht} eq 2"></i>-->
                                        <!--<i class="text-green fa fa-circle" th:if="${tableData.ht} eq 3"></i>-->
                                        <span class="label  badge label-danger" th:if="${tableData.ht} eq -1">不需要</span>
                                        <span class="label  badge label-default" th:if="${tableData.ht} eq 1">未开始</span>
                                        <span class="label  badge label-warning" th:if="${tableData.ht} eq 2">执行中</span>
                                        <span class="label  badge label-success" th:if="${tableData.ht} eq 3">已完成</span>
                                    </td>
                                    <td id="kuanpiaoStatus">

                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.fp} eq 0"></i>-->
                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.fp} eq 1"></i>-->
                                        <!--<i class="text-yellow fa fa-clock-o" th:if="${tableData.fp} eq 2"></i>-->
                                        <!--<i class="text-green fa fa-circle" th:if="${tableData.fp} eq 3"></i>-->
                                        <span class="label  badge label-danger" th:if="${tableData.fp} eq -1">不需要</span>
                                        <span class="label  badge label-default" th:if="${tableData.fp} eq 1">未开始</span>
                                        <span class="label  badge label-warning" th:if="${tableData.fp} eq 2">执行中</span>
                                        <span class="label  badge label-success" th:if="${tableData.fp} eq 3">已完成</span>
                                    </td>

                                    <td id="hesuanStatus">

                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.hs} eq 0"></i>-->
                                        <!--<i class="text-grey fa fa-circle-o" th:if="${tableData.hs} eq 1"></i>-->
                                        <!--<i class="text-yellow fa fa-clock-o" th:if="${tableData.hs} eq 2"></i>-->
                                        <!--<i class="text-green fa fa-circle" th:if="${tableData.hs} eq 3"></i>-->
                                        <span class="label  badge label-danger" th:if="${tableData.hs} eq -1">不需要</span>
                                        <span class="label  badge label-default" th:if="${tableData.hs} eq 1">未开始</span>
                                        <span class="label  badge label-warning" th:if="${tableData.hs} eq 2">执行中</span>
                                        <span class="label  badge label-success" th:if="${tableData.hs} eq 3">已完成</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td th:text="${gaisuan}" style="height: 40px; line-height: 40px;"></td>
                                    <td th:text="${yusuan}"></td>
                                    <td th:text="${baojia}"></td>
                                    <td th:text="${hetong}"></td>
                                    <td th:text="${kuanpiao}"></td>
                                    <td th:text="${hesuan}"></td>
                                </tr>
                                <tr>
                                    <!--<td height="1" style="box-shadow:#e4644a 0px 6px 0px; border-radius:0px 0px 5px 5px;padding-bottom:8px;"></td>-->
                                    <td style="box-shadow: #7C90FF 0px 6px 0px; border-radius:0px 0px 5px 5px;padding-bottom:8px;"></td>
                                    <td style="box-shadow:#7C90FF 0px 6px 0px; border-radius:0px 0px 5px 5px;padding-bottom:8px;"></td>
                                    <td style="box-shadow:#09B2C7 0px 6px 0px; border-radius:0px 0px 5px 5px;padding-bottom:8px;"></td>
                                    <td style="box-shadow: #09B2C7 0px 6px 0px; border-radius:0px 0px 5px 5px;padding-bottom:8px;"></td>
                                    <td style="box-shadow: #09B2C7 0px 6px 0px; border-radius:0px 0px 5px 5px;padding-bottom:8px;"></td>
                                    <td style="box-shadow: #7C90FF 0px 6px 0px; border-radius:0px 0px 5px 5px;padding-bottom:8px;"></td>
                                </tr>
                                </tbody>
                            </table>
                            <!-- 第二个 -->
                            <div class="col-md-12 col-sm-12 col-xs-12" style="margin-top: 10px;">
                                <div class="form-group">
                                    <label>备注说明:</label>
                                    <span id="remark" th:text="${remark}"></span>
                                    <!--<textarea id="remark" class="form-control" rows="3" readonly th:text="${remark}" style="background-color: #fff; resize: none;"></textarea>-->
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--<div class="row" id="toolbarOld">-->
                        <!--<div class="pull-right" style=" font-size: 16px; font-family: 'Microsoft YaHei UI'; line-height: 50px;">-->
                            <!--<i class="fa fa-circle-o text-grey"></i>&nbsp;未开始-->
                            <!--<i class="fa fa-clock-o text-yellow"></i>&nbsp;执行中-->
                            <!--<i class="fa fa-circle text-green"></i>&nbsp;已完成-->
                        <!--</div>-->
                    <!--</div>-->
                </div>
                <div class="box-body" style=" font-size: 16px; background-color: #EBF4F9; min-height: 450px;">
                    <div id="divRight" class="hidden" style="background-color: #FFFFFF; width: 30px;text-align: center;
                     border: solid 1px #eee; cursor: pointer; float: left; height: 450px; line-height: 450px; margin: auto 0px; border-radius: 2px; " onclick="rightDiv();">
                        <i class="fa fa-caret-right" style="color: #3C8DBC; font-size: 20px;"></i>
                    </div>
                    <div class="box" id="divLeft" style="width:13%; float: left; height: 100%; min-height: 450px; min-width: 170px;">
                        <div  class="box-header" style="height: 60px; line-height: 40px; vertical-align: middle; text-align: center; ">
                            <i class="fa fa-list" style="color: #333; cursor: pointer; line-height: 20px; " onclick="initZonglanDiv()">&nbsp;&nbsp;&nbsp;商务任务</i>
                            <!--<span style="color: #333;font-family: 'Microsoft YaHei UI';">商务任务</span>-->
                            <div style="background-color: #F8F8F8; width: 20px;text-align: center; border: solid 1px #eee; cursor: pointer; float: right; height: 40px; line-height: 40px; margin: auto 0px; " onclick="leftDiv();">
                                <i class="fa fa-caret-left" style="color: #3C8DBC; font-size: 18px;"></i>
                            </div>
                        </div>
                        <div class="box-body" style="border-top: 1px solid #EEEEEE;">
                            <ul class="sidebar-menu tree" data-widget="tree">
                                <li class="text-center"> <a href="#" style="padding: 12px 0;" onclick="readData('概算')">概算</a></li>
                                <li class="text-center"><a href="#" style="padding: 12px 0;" onclick="readData('预算')">预算</a></li>
                                <li class="text-center"> <a href="#" style="padding: 12px 0;" onclick="readData('报价')">报价</a></li>
                                <li class="text-center"><a href="#" style="padding: 12px 0;"  onclick="readData('合同')">合同</a></li>
                                <li class="text-center"> <a href="#" style="padding: 12px 0;" onclick="readData('款票')">款票</a></li>
                                <li class="text-center"> <a href="#" style="padding: 12px 0;" onclick="readData('核算')">核算</a></li>
                            </ul>
                            <!--<button type="button" class="btn btn-success" style="width: 100%; margin-top: 30px;" >-->
                                <!--<span class="Bold">预算</span>-->
                            <!--</button>-->
                            <!--<button type="button" class="btn btn-default" style="width: 100%; margin-top: 30px;">-->
                                <!--<span class="Bold">核算</span>-->
                            <!--</button>-->
                        </div>
                    </div>

                    <div class="box" style="width:85%; float: left; margin-left: 1%; min-height: 450px;" id="contetDiv">
                        <div id="zonglanDiv" style="display: none;">
                            <div class="box-header">
                                <h4>商务任务节点信息总览</h4>
                            </div>
                            <div class="box-body">
                                <div>
                                    <table id="bootstrap-table" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                                </div>
                            </div>
                        </div>
                        <!--概算预算核算-->
                        <div id="gaisuanDiv" style="display: none;">
                            <div class="box-header">
                                <h4 id="gaisuanTitle">商务任务概算信息总览</h4>
                            </div>
                            <div class="box-body">
                                <div>
                                    <button id="gsBtn" class="btn pull-right btn-info" style="margin-bottom: 5px;"  onclick="lookDetail(1)">查看详细</button>
                                    <!--<table id="dataSourceTable" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>-->
                                    <span id="gaisuanRemark" class="label label-warning"></span>
                                    <table id="subTaskTable" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                                    <button type="button" shiro:hasPermission="task:cost:down" class="btn btn-success pull-left" data-dismiss="modal" onclick="downFile()" style="margin-bottom: 3px;">批量下载</button>
                                    <button id="uploadBtn" shiro:hasPermission="task:cost:upload" class="btn pull-right btn-success" style="margin-top: 5px;margin-bottom: 5px;"  onclick="uploadFiles(29)">上传附件</button>
                                    <table id="subTaskTableFile" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;" class="table table-hover table-striped">
                                    </table>
                                </div>
                            </div>
                        </div>

                        <div id="baojiaDiv" style="display: none;">
                            <div class="box-header">
                                <h4>商务任务报价信息总览</h4>
                            </div>
                            <div class="box-body">
                                <div>
                                    <button id="bjBtn" class="btn pull-right btn-info" style="margin-bottom: 5px;"  onclick="lookDetail(2)">查看详细</button>
                                    <span id="baojiaRemark" class="label label-warning"></span>
                                    <table id="baojiaTable" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                                </div>
                            </div>
                        </div>

                        <div id="hetongDiv" style="display: none;">
                            <div class="box-header">
                                <h4>商务任务合同信息总览</h4>
                            </div>
                            <div class="box-body">
                                <div>
                                    <button id="htBtn" class="btn pull-right btn-info" style="margin-bottom: 5px;" onclick="lookDetail(3)">查看详细</button>
                                    <span id="hetongRemark" class="label label-warning"></span>
                                    <table id="hetongTable" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                                    <button type="button" shiro:hasPermission="task:cost:down" class="btn btn-success pull-left" data-dismiss="modal" onclick="downContractFile()" style="margin-bottom: 3px;">批量下载</button>
                                    <!--<button id="uploadContractBtn" shiro:hasPermission="task:cost:upload" class="btn pull-right btn-success" style="margin-top: 5px;margin-bottom: 5px;"  onclick="uploadFiles(29)">上传附件</button>-->
                                    <table id="subTaskContractTableFile" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;" class="table table-hover table-striped">
                                    </table>
                                </div>
                            </div>
                        </div>

                        <div id="kuanpiaoDiv" style="display: none;">
                            <div class="box-header">
                                <h4>商务任务款票信息总览</h4>
                            </div>
                            <div class="box-body">
                                <div>
                                    <button id="kpBtn" class="btn pull-right btn-info" style="margin-bottom: 5px;" onclick="lookDetail(4)">查看详细</button>
                                    <span id="kuanpiaoRemark" class="label label-warning"></span>
                                    <table id="kuanpiaoTable" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--上传模态框 项目附件-->
    <div class="modal fade" data-backdrop="static" data-keyboard="false" id="modal-upload" style="z-index: 1060">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">概算任务进度编辑</h4>
                </div>
                <div class="modal-body" style=" padding: 0px;">
                    <form id="uploadForm">
                        <input type="hidden" id="kind" name="tkind">
                        <input type="hidden" id="fkId" name="fkId">

                        <!--<div class="form-group">-->
                            <!--<label class="col-sm-3 control-label">状态</label>-->
                            <!--<div class="col-sm-8">-->
                                <!--<select name="tstatus" class="form-control" style="width:100px;">-->
                                    <!--<option value="-1" selected="selected">未开始</option>-->
                                    <!--<option value="2">执行中</option>-->
                                    <!--<option value="3">已完成</option>-->
                                <!--</select>-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="form-group">
                            <label class="col-sm-3 control-label" style="margin-top:10px;">开始时间</label>
                            <div class="col-sm-8" style="margin-top:10px;">
                                <input type="text" class="form-control datepicker" name="beginDateStr" placeholder="开始时间">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label" style="margin-top:10px;">结束时间</label>
                            <div class="col-sm-8" style="margin-top:10px;">
                                <input type="text" class="form-control datepicker" name="endDateStr" placeholder="结束时间">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label" style="margin-top:10px;">执行人</label>
                            <div class="col-sm-8" style="margin-top:10px;">
                                <input type="text" class="form-control" name="keyPerson" placeholder="执行人">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label" style="margin-top:10px;">备注</label>
                            <div class="col-sm-8" style="margin-top:10px;">
                            <textarea class="form-control text-left" rows="2" name="remark"
                                      style="resize: none;"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer" style="border: none;">
                    <button id="btn-upload" type="button" class="btn btn-success" style="margin-top: 20px">
                        <span class="Bold">确定</span>
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal"
                            style="margin-top: 20px">取消
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!--上传模态框 一般附件-->
    <div class="modal fade" data-backdrop="static" data-keyboard="false" id="modal-uploadFile" style="z-index: 1060">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">上传附件</h4>
                </div>
                <div class="modal-body" style=" padding: 0px;">
                    <form id="uploadFileForm">
                        <input type="hidden" id="fkIdUpd" name="fkId">
                        <input type="hidden" id="fileType" name="fileType" value="2">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">选择文件并上传</label>
                            <div class="col-sm-8">
                                <input id="import-file2" class="btn" type="file" name="file">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">文件备注</label>
                            <div class="col-sm-8">
                            <textarea class="form-control text-left" rows="2" name="remark"
                                      style="resize: none;"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer" style="border: none;">
                    <button id="btn-uploadFile" type="button" class="btn btn-success" style="margin-top: 20px">
                        <span class="Bold">确定</span>
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal"
                            style="margin-top: 20px">取消
                    </button>
                </div>
            </div>
        </div>
    </div>
    <form id="downloadPackageForm" enctype="application/x-www-form-urlencoded;charset=utf-8" action="/downloadPackage" style="display: none" method="get">
        <input name="dataName" type="hidden" value=""/>
    </form>
</section>
<div th:include="include :: footer"></div>

<script th:inline="javascript">
    var table22;
    var table23;
    /**
     * 初始化 文件数量**********************
     */
    getGaisuanCnt(29);
    getGaisuanCnt(30);
    getGaisuanCnt(35);
    getBaoJiaCnt();
    getHetongCnt();
    getKuanpiaoCnt();
//************************end********************
    $("#toggle").click(function() {
        $(".menu").toggleClass("closed");
        $(this).toggleClass("closed");
        $(".content").toggleClass("closed");
        $("#wrapper").toggleClass("closed")
    });

    function rightDiv(){
        $("#divRight").addClass("hidden");
        $("#divLeft").removeClass("hidden");
        $("#contetDiv").css("width","85%");
    }
    function leftDiv(){
        $("#divLeft").addClass("hidden");
        $("#divRight").removeClass("hidden");
        $("#contetDiv").css("width","95%");
    }
    function readData(paramType){
        var taskid=0;
        //附件的类型
        // 29   概算
        // 30	预算
        // 33	发票
        // 34	回款
        // 35	核算

        var fileKind= "";

        switch (paramType) {
            case ("概算"):
                taskid=7;
                fileKind = '29';
                break;
            case ("预算"):
                taskid=1;
                fileKind = '30';
                break;
            case ("核算"):
                taskid=6;
                fileKind = '35';
                break;
            case ("报价"):
                taskid=2;
                fileKind = '1,2';
                break;
            case ("合同"):
                taskid=3;
                fileKind = '3,4,5,7,8,9,10';
                break;
            case ("款票"):
                taskid=4;
                fileKind= '34';
                break;
            default:
                taskid=0;
                break;
        }

        var remark="";
        /** 加载采集数据表格 */
        js.post({
            url: ctx + "taskBase/selectReamrkById",
            data: { id:$("#AssignedId").val(), kind:taskid},
            async:false,
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    // js.modal.success(result.msg);
                    remark=result.data;

                } else {
                    js.modal.warning(result.msg);
                }
                js.modal.closeLoading();
            }
        });

        if(remark!=""){
            remark="备注："+remark;
        }

       if(paramType=="概算" ||paramType=="预算"|| paramType=="核算"){

           $("#zonglanDiv").hide();
           $("#gaisuanDiv").show();
           $("#baojiaDiv").hide();
           $("#hetongDiv").hide();
           $("#kuanpiaoDiv").hide();

           $("#gaisuanDiv").find('span').text(remark);

          $("#gaisuanTitle").html("商务任务"+paramType+"信息总览");

          if(paramType=="概算"){
              taskid=7;
              $('#gsBtn').attr("onclick","lookDetail(7)");
              $('#uploadBtn').attr("onclick","uploadFiles(29)");
              $('#uploadBtn').show();
          }else if(paramType=="预算"){
              taskid=1;
              $('#gsBtn').attr("onclick","lookDetail(1)");
              $('#uploadBtn').attr("onclick","uploadFiles(30)");
              $('#uploadBtn').show();
          }else if(paramType=="核算") {
              taskid=6;
              $('#gsBtn').attr("onclick","lookDetail(6)");
              $('#uploadBtn').attr("onclick","uploadFiles(35)");
              $('#uploadBtn').show();
          }

                var table1;
                /** 加载采集数据表格 */
                // $('#dataSourceTable').bootstrapTable('destroy');
                // table1 = js.table.init({
                //     id:"dataSourceTable",
                //     url: ctx + "taskBase/selectDataStatusById",
                //     queryData:{
                //         id:$("#AssignedId").val(),
                //         kind:taskid},
                //     showColumns: false,
                //     showExport: false,
                //     pagination : true,
                //     pageSize:10,
                //     columns: [
                //         {
                //             title: '序号', field: 'id', width: '50'
                //         },
                //         { title: "成本数据类型", field: 'dataType'},
                //         { title: "数据来源", field: 'dataSource'},
                //         { title: "部分", field: 'part'},
                //         { title: "提交时间", field: 'submitDT'},
                //         { title: "获取时间", field: 'getDT'},
                //         { title: "获取人", field: 'getUser'}
                //         // ,
                //         // { title: "操作", field: 'id',
                //         //     formatter: function(value, row, index){
                //         //         var actions = [];
                //         //         actions.push('<a class="btn btn-primary btn-xs" href="' + ctx + 'dataSourceDetail?id= ' + row.id + '&kind=1"> 查看</a> ');
                //         //         return actions.join('');
                //         //     }
                //         // }
                //     ]
                // });
               var table2;
               //重新加载数据
               $('#subTaskTable').bootstrapTable('destroy');

                /** 加载审批流程表格 */
                table2 = js.table.init({
                    id:"subTaskTable",
                    url: ctx + "taskBase/selectAppProgressById",
                    queryData:{
                        id:$("#AssignedId").val()},
                    showColumns: false,
                    showExport: false,
                    pagination : false,
                    columns: [
                        { title: '序号', field: 'id', width: '50'            },
                        { title: "任务名称", field: 'tname'},
                        { title: "节点类型", field: 'leve'},
                        { title: "提交/审批时间", field: 'startDT'},
                        { title: "审批结果", field: 'appStatus'},
                        { title: "审批意见", field: 'remark'},
                        // { title: "工作组", field: 'wgroup'},
                        { title: "执行人", field: 'doUser'}
                    ]
                });

           //重新加载数据
           $('#subTaskTableFile').bootstrapTable('destroy');

           /** 加载文件表格 */
           table22 = js.table.init({
               id:"subTaskTableFile",
               url: ctx + "taskBase/selectNodeFilesById",
               queryData:{
                   id:$("#AssignedId").val(), fileKind: fileKind},
               showColumns: false,
               showExport: false,
               pagination : false,
               columns: [
                   {
                       checkbox: true
                   },
                   { title: '序号', field: 'id', width: '50'},
                   { title: "文件名称", field: 'dataName'},
                   { title: "备注", field: 'remark'},
                   { title: "上传人", field: 'doUser',width: '100'},
                   { title: "上传时间", field: 'submitDT',width: '100'},
                   { title: "操作", field: 'dataSource',width: '150',
                       formatter: function (value, row, index) {
                           var actions = [];
                           if (hasP('task:cost:down')){
                               actions.push('<a  class="btn btn-info btn-xs"  target="_blank" href="'+ctx +'downloadFile/'+row.dataId+'/0"> 下载</a> ');
                           }
                           if (hasP('task:cost:del')) {
                               actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)"  onclick="delFileInfo(' + row.dataId + ','+row.tkind+')"> 删除</a> ');
                           }
                               return actions.join('');
                       }
                   }
               ]
           });
        }
        else if(paramType=="报价"){
           $("#zonglanDiv").hide();
           $("#gaisuanDiv").hide();
           $("#baojiaDiv").show();
           $("#hetongDiv").hide();
           $("#kuanpiaoDiv").hide();

           $("#baojiaDiv").find('span').text(remark);
           taskid=2;
           $('#baojiaTable').bootstrapTable('destroy');
           /** 加载审批流程表格 */
           table = js.table.init({
               id:"baojiaTable",
               url: ctx + "taskBase/selectAppProgressById",
               queryData:{
                   id:$("#AssignedId").val(),taskid:taskid},
               showColumns: false,
               showExport: false,
               pagination : false,
               columns: [
                   { title: '序号', field: 'id', width: '50'            },
                   { title: "任务名称", field: 'tname'},
                   { title: "节点类型", field: 'leve'},
                   { title: "提交/审批时间", field: 'startDT'},
                   { title: "审批结果", field: 'appStatus'},
                   { title: "审批意见", field: 'remark'},
                   // { title: "工作组", field: 'wgroup'},
                   { title: "执行人", field: 'doUser'}
               ]
           });
        }
        else if(paramType=="合同"){
           $("#zonglanDiv").hide();
           $("#gaisuanDiv").hide();
           $("#baojiaDiv").hide();
           $("#hetongDiv").show();
           $("#kuanpiaoDiv").hide();
           $("#hetongDiv").find('span').text(remark);
           taskid=3;
           $('#hetongTable').bootstrapTable('destroy');
           $('#subTaskContractTableFile').bootstrapTable('destroy');
           /** 加载审批流程表格 */
           table = js.table.init({
               id:"hetongTable",
               url: ctx + "taskBase/selectAppProgressById",
               queryData:{
                   id:$("#AssignedId").val(),taskid:taskid},
               showColumns: false,
               showExport: false,
               pagination : false,
               columns: [
                   { title: '序号', field: 'id', width: '50'},
                   { title: "任务名称", field: 'tname'},
                   { title: "节点类型", field: 'leve'},
                   { title: "提交/审批时间", field: 'startDT'},
                   { title: "审批结果", field: 'appStatus'},
                   { title: "审批意见", field: 'remark'},
                   // { title: "工作组", field: 'wgroup'},
                   { title: "执行人", field: 'doUser'}
               ]
           });

           table23 = js.table.init({
               id:"subTaskContractTableFile",
               url: ctx + "taskBase/selectContractFilesById",
               queryData:{
                   id:$("#AssignedId").val(),fileKind:fileKind},
               showColumns: false,
               showExport: false,
               pagination : false,
               columns: [
                   {
                       checkbox: true
                   },
                   { title: '序号', field: 'id', width: '50'},
                   { title: "文件名称", field: 'dataName'},
                   { title: "备注", field: 'remark'},
                   { title: "上传人", field: 'doUser',width: '100'},
                   { title: "上传时间", field: 'submitDT',width: '100'},
                   { title: "操作", field: 'dataSource',width: '150',
                       formatter: function (value, row, index) {
                           var actions = [];
                           if (hasP('task:cost:down')){
                               actions.push('<a  class="btn btn-info btn-xs"  target="_blank" href="'+ctx +'downloadFile/'+row.dataId+'/0"> 下载</a> ');
                           }
                           // if (hasP('task:cost:del')) {
                           //     actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)"  onclick="delContractFileInfo(' + row.dataId + ','+row.tkind+')"> 删除</a> ');
                           // }
                           return actions.join('');
                       }
                   }
               ]
           });
        }
        else if(paramType=="款票"){
           $("#zonglanDiv").hide();
           $("#gaisuanDiv").hide();
           $("#baojiaDiv").hide();
           $("#hetongDiv").hide();
           $("#kuanpiaoDiv").show();
           $("#kuanpiaoDiv").find('span').text(remark);
           taskid=4;
           $('#kuanpiaoTable').bootstrapTable('destroy');
           /** 加载审批流程表格 */
           table = js.table.init({
               id:"kuanpiaoTable",
               url: ctx + "taskBase/selectAppProgressById",
               queryData:{
                   id:$("#AssignedId").val(),taskid:taskid },
               showColumns: false,
               showExport: false,
               pagination : false,
               columns: [
                   { title: '序号', field: 'id', width: '50'            },
                   { title: "任务名称", field: 'tname'},
                   { title: "节点类型", field: 'leve'},
                   { title: "提交/审批时间", field: 'startDT'},
                   { title: "审批结果", field: 'appStatus'},
                   { title: "审批意见", field: 'remark'},
                   // { title: "工作组", field: 'wgroup'},
                   { title: "执行人", field: 'doUser'}
               ]
           });

        }
    }

    /**
     * 初始化时候就执行
     */
    initZonglanDiv();


    /**
     * 商务任务总览页面
     */
    function initZonglanDiv() {
        $("#zonglanDiv").show();
        $("#gaisuanDiv").hide();
        $("#baojiaDiv").hide();
        $("#hetongDiv").hide();
        $("#kuanpiaoDiv").hide();
        /**
         * 页面初始化时候就加载表格
         */
        /** 加载用户表格 */
        table = js.table.init({
            url: ctx + "taskBase/selectTaskProgressById",
            data:{id:$("#AssignedId").val()},
            showColumns: false,
            showExport: false,
            pagination : false,
            columns: [
                { title: '序号', field: 'id', width: '50'},
                { title: "商务任务", field: 'tname'},
                { title: "包含项目", field: 'content'},
                { title: "任务开始时间", field: 'startDT'},
                { title: "审批结束时间", field: 'endDT'},
                { title: "审批等级", field: 'leve'},
                // { title: "工作组", field: 'wgroup'},
                { title: "任务执行人", field: 'doUser'}
            ]
        });
    }

    /**
     * 查看明细的连接
     * @param tkind
     */
    function lookDetail(tkind){
        // var id=$("#AssignedId").val();

        js.post({
            url: ctx + "task/linkDetail",
            data: {id:$("#AssignedId").val(),tkind:tkind},
            success: function (result) {

                if (result.type === web_status.SUCCESS) {

                    //1 预算 7 概算 6 核算 2 报价 3 合同 4 款票
                    if(tkind==1 || tkind==7 || tkind==6){
                        window.open("/accountManage/showAccCostSheet/"+result.data);
                    }else if(tkind==2){
                        // /quoteManage/viewQuotation/quoteId/242(id)
                        window.open("/quoteManage/viewQuotation/quoteId/"+result.data);
                    }else if(tkind==3){
                        // /contractManage/lookContract?quoteId=189&conId=16&parentId=0
                        window.open("/contractManage/lookContract?quoteId=0&conId="+result.data+"&parentId=0");
                    }else if(tkind==4){
                       // /kpSelect/contractInfo?conId=1
                        window.open("/kpSelect/contractInfo?conId="+result.data);
                    }
                } else {
                    js.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            }
        });
    }
    function updateTask(kind,status){
        $("#modal-upload [name='fkId']").val($("#AssignedId").val());
        $("#kind").val(kind);
        js.post({
            url: ctx + "taskApply/selectTaskByFkId",
            data: {"fkId":$("#AssignedId").val(),"tkind":kind},
            async: true,
            success: function (result) {

                $("#uploadForm").fillData(result.data);
            }
        });

        // $("#modal-upload [name='tstatus']").find("option[text='"+status+"']").attr("selected",true);

        js.modal.open("modal-upload");
    }

    /**
     * 上传
     */
    $("#btn-upload").on('click', function () {

        js.submit({
            url: ctx + "taskApply/updTaskData",
            data: new FormData($("#uploadForm")[0]),
            async: true,
            success: function (result) {
               js.modal.success("保存成功");
            }
        });
        js.modal.hide("modal-upload");
    });

    /**
     * 文件类型
     * @param fType
     */
    function uploadFiles(fType){
        $("#fkIdUpd").val($("#AssignedId").val());
        $("#fileType").val(fType);
        js.modal.open("modal-uploadFile");
    }
    /**
     * 上传
     */
    $("#btn-uploadFile").on('click', function () {

        if ($("#modal-uploadFile").find("input[name='file']").get(0).files[0]==undefined) {
            js.modal.warning("请至少选择一个文件");
            return false;
        }

        js.submit({
            url: ctx + "contractManage/uploadFileGYH",
            data: new FormData($("#uploadFileForm")[0]),
            async:true,
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    js.modal.success(result.msg);

                    //重新加载数据
                    $('#subTaskTableFile').bootstrapTable('destroy');

                    /** 加载审批流程表格 */
                    table22 = js.table.init({
                        id:"subTaskTableFile",
                        url: ctx + "taskBase/selectNodeFilesById",
                        queryData:{
                            id:$("#AssignedId").val(),taskid:$("#fileType").val()},
                        showColumns: false,
                        showExport: false,
                        pagination : false,
                        columns: [
                            {
                                checkbox: true
                            },
                            { title: '序号', field: 'id', width: '50'},
                            { title: "文件名称", field: 'dataName'},
                            { title: "备注", field: 'remark'},
                            { title: "上传人", field: 'doUser',width: '100'},
                            { title: "上传时间", field: 'submitDT',width: '100'},
                            { title: "操作", field: 'dataSource',width: '150',
                                formatter: function (value, row, index) {
                                    var actions = [];
                                    if (hasP('task:cost:down')) {
                                        actions.push('<a  class="btn btn-info btn-xs"  target="_blank" href="'+ctx +'downloadFile/'+row.dataId+'/0"> 下载</a> ');
                                    }
                                    if (hasP('task:cost:del')) {
                                        actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)"  onclick="delFileInfo(' + row.dataId + ','+row.tkind+')"> 删除</a> ');
                                    }
                                    return actions.join('');
                                }
                            }
                        ]
                    });
                    getGaisuanCnt($("#fileType").val());
                } else {
                    js.modal.warning(result.msg);
                }
            }
        });
        js.modal.hide("modal-uploadFile");
    });

    /**
     * 模态框隐藏事件， 重置表单，重置验证
     */
    js.modal.hideEvent("modal-uploadFile", function () {
        $("#uploadFileForm" )[0].reset();
    });
    /**
     * 删除附件
     */
    function delFileInfo(fileId,tkind){
        js.modal.confirm("确定删除吗？", function () {
            js.post({
                url: ctx + "file/delFileInfo",
                data:{"id":fileId},
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        //重新加载数据
                        // $('#subTaskTableFile').bootstrapTable('destroy');
                        js.table.refresh(table22);
                        /** 加载审批流程表格 */
                        // table22 = js.table.init({
                        //     id:"subTaskTableFile",
                        //     url: ctx + "taskBase/selectNodeFilesById",
                        //     queryData:{
                        //         id:$("#AssignedId").val(),taskid:tkind},
                        //     showColumns: false,
                        //     showExport: false,
                        //     pagination : false,
                        //     columns: [
                        //         {
                        //             checkbox: true
                        //         },
                        //         { title: '序号', field: 'id', width: '50'},
                        //         { title: "文件名称", field: 'dataName'},
                        //         { title: "备注", field: 'remark'},
                        //         { title: "上传人", field: 'doUser',width: '100'},
                        //         { title: "上传时间", field: 'submitDT',width: '100'},
                        //         { title: "操作", field: 'dataSource',width: '150',
                        //             formatter: function (value, row, index) {
                        //                 var actions = [];
                        //                 if (hasP('task:cost:down')) {
                        //                     actions.push('<a  class="btn btn-info btn-xs"  target="_blank"  href="'+ctx +'downloadFile/'+row.dataId+'/0"> 下载</a> ');
                        //                 }
                        //                 if (hasP('task:cost:del')) {
                        //                     actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)"  onclick="delFileInfo(' + row.dataId + ','+row.tkind+')"> 删除</a> ');
                        //                 }
                        //                 return actions.join('');
                        //             }
                        //         }
                        //     ]
                        // });
                        getGaisuanCnt(tkind);
                    } else {
                        js.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                }
            });
        });
    }

    /**
     * 删除附件
     */
    // function delContractFileInfo(fileId,tkind){
    //     js.modal.confirm("确定删除吗？", function () {
    //         js.post({
    //             url: ctx + "file/delFileInfo",
    //             data:{"id":fileId},
    //             success: function (result) {
    //                 if (result.type === web_status.SUCCESS) {
    //                     js.modal.success(result.msg);
    //                     //重新加载数据
    //                     js.table.refresh(table23);
    //                     // $('#subTaskTableFile').bootstrapTable('destroy');
    //                     //
    //                     // /** 加载审批流程表格 */
    //                     // table22 = js.table.init({
    //                     //     id:"subTaskTableFile",
    //                     //     url: ctx + "taskBase/selectContractFilesById",
    //                     //     queryData:{
    //                     //         id:$("#AssignedId").val(),taskid:tkind},
    //                     //     showColumns: false,
    //                     //     showExport: false,
    //                     //     pagination : false,
    //                     //     columns: [
    //                     //         {
    //                     //             checkbox: true
    //                     //         },
    //                     //         { title: '序号', field: 'id', width: '50'},
    //                     //         { title: "文件名称", field: 'dataName'},
    //                     //         { title: "备注", field: 'remark'},
    //                     //         { title: "上传人", field: 'doUser',width: '100'},
    //                     //         { title: "上传时间", field: 'submitDT',width: '100'},
    //                     //         { title: "操作", field: 'dataSource',width: '150',
    //                     //             formatter: function (value, row, index) {
    //                     //                 var actions = [];
    //                     //                 if (hasP('task:cost:down')) {
    //                     //                     actions.push('<a  class="btn btn-info btn-xs"  target="_blank"  href="'+ctx +'downloadFile/'+row.dataId+'/0"> 下载</a> ');
    //                     //                 }
    //                     //                 if (hasP('task:cost:del')) {
    //                     //                     actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)"  onclick="delFileInfo(' + row.dataId + ','+row.tkind+')"> 删除</a> ');
    //                     //                 }
    //                     //                 return actions.join('');
    //                     //             }
    //                     //         }
    //                     //     ]
    //                     // });
    //                     getHetongCnt(tkind);
    //                 } else {
    //                     js.modal.warning(result.msg);
    //                 }
    //                 js.modal.closeLoading();
    //             }
    //         });
    //     });
    // }



    /**
     * 文件数量
     * @param tkind
     */
    function getGaisuanCnt(tkind){
        js.post({
            url: ctx + "taskBase/selectFilescCntById",
            data:{id:$("#AssignedId").val(),taskid:tkind},
            success: function (result) {
                if(tkind==29){
                    //概算
                    if(result.data==0){
                        $("#gaisuanCnt").html("&nbsp;&nbsp;&nbsp;&nbsp;");
                        $('#gaisuanCnt').css("background-color", "#7C90FF");
                    }else{
                        $("#gaisuanCnt").html(result.data+"个");
                        $('#gaisuanCnt').css("background-color", "#fff");
                    }
                }else if(tkind==30){
                    //预算
                    if(result.data==0){
                        $("#yusuanCnt").html("&nbsp;&nbsp;&nbsp;&nbsp;");
                        $('#yusuanCnt').css("background-color", "#7C90FF");
                    }else{
                        $("#yusuanCnt").html(result.data+"个");
                        $('#yusuanCnt').css("background-color", "#fff");
                    }
                }else if(tkind==35){
                    //核算
                    if(result.data==0){
                        $("#hesuanCnt").html("&nbsp;&nbsp;&nbsp;&nbsp;");
                        $('#hesuanCnt').css("background-color", "#7C90FF");
                    }else{
                        $("#hesuanCnt").html(result.data+"个");
                        $('#hesuanCnt').css("background-color", "#fff");
                    }
                }
                js.modal.closeLoading();
            }
        });
    }

    /**
     * 文件数量-报价
     *
     */
    function getBaoJiaCnt(){
        js.post({
            url: ctx + "taskBase/selectBJFilescCntById",
            data:{id:$("#AssignedId").val()},
            success: function (result) {
                    //报价
                    if(result.data==0){
                        $("#baojiaCnt").html("&nbsp;&nbsp;&nbsp;&nbsp;");
                        $('#baojiaCnt').css("background-color", "#09B2C7");
                    }else{
                        $("#baojiaCnt").html(result.data+"个");
                        $('#baojiaCnt').css("background-color", "#fff");
                    }
                js.modal.closeLoading();
            }
        });
    }

    /**
     * 文件数量-合同
     *
     */
    function getHetongCnt(){
        js.post({
            url: ctx + "taskBase/selectHTFilescCntById",
            data:{id:$("#AssignedId").val()},
            success: function (result) {
                //合同
                if(result.data==0){
                    $("#hetongCnt").html("&nbsp;&nbsp;&nbsp;&nbsp;");
                    $('#hetongCnt').css("background-color", "#09B2C7");
                }else{
                    $("#hetongCnt").html(result.data+"个");
                    $('#hetongCnt').css("background-color", "#fff");
                }
                js.modal.closeLoading();
            }
        });
    }

    /**
     * 文件数量-款票
     *
     */
    function getKuanpiaoCnt(){
        js.post({
            url: ctx + "taskBase/selectKPFilescCntById",
            data:{id:$("#AssignedId").val()},
            success: function (result) {
                //报价
                if(result.data==0){
                    $("#kuanpiaoCnt").html("&nbsp;&nbsp;&nbsp;&nbsp;");
                    $('#kuanpiaoCnt').css("background-color", "#09B2C7");
                }else{
                    $("#kuanpiaoCnt").html(result.data+"个");
                    $('#kuanpiaoCnt').css("background-color", "#fff");
                }
                js.modal.closeLoading();
            }
        });
    }
    /**
     * 样机成本附件的批量下载
     */
    function downFile(){
        var arr = js.table.selectColumns(table22, "dataId");
        if (arr.length <= 0) {
            js.modal.warning("请至少选择一个文件");
            return false;
        }
        $("#subTaskTableFile").find('tr').removeClass("selected");
        downloadPackage(arr);
    }

    function downContractFile(){
        debugger;
        var arr = js.table.selectColumns(table23, "dataId");
        if (arr.length <= 0) {
            js.modal.warning("请至少选择一个文件");
            return false;
        }
        $("#subTaskContractTableFile").find('tr').removeClass("selected");
        downloadPackage(arr);
    }

    /**
     * 打包下载
     */
    function downloadPackage(fileIds) {
        $("#downloadPackageForm [name='dataName']").val(fileIds);
        $("#downloadPackageForm").submit();
        $("#downloadPackageForm [name='dataName']").val('');

    }
</script>


